<%-- 
    Document   : modificarContratoTelefonia
    Created on : 27-ago-2009, 0:29:49
    Author     : Ale
--%>

<%@page contentType="text/html" pageEncoding="UTF-8" session="false"  import="domain.*, planner.*, java.util.*"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>DOMECO</title>
        <link href="style.css" rel="stylesheet" type="text/css">

            <style type="text/css">@import url(./js/calendar-blue2.css);</style>
        <script type="text/javascript" src="./js/calendar.js"></script>
        <script type="text/javascript" src="./js/calendar-es.js"></script>
        <script type="text/javascript" src="./js/calendar-setup.js"></script>

        <script type="text/javascript">
//inicializo el calendario
window.onload = function() {
  Calendar.setup({
    inputField: "fecha",
    ifFormat:  "%Y-%m-%d",
    button:     "mas"
  });

}
</script>
    </head>
    <body>
        <%if (request.getSession(false) != null) {%>
        <table align="center" width="1000" >
            <tr>
                <td>
                    <div id="menu" align="center"><jsp:include page="./menu principal.jsp"></jsp:include></div>
                    <br>
                        <p id="campoAzul" align="center" valign="middle" width="235px"><span id="blanco">Móviles</span><br></p>
        <span id="azulTitulo"> Modificar Contrato de Teléfono</span>
                    <div id="general">
                        <div id="cuenta" align="center" >

                            <form action="./Updater?type=mobileCont&redir=T&idC=<%=request.getParameter("idMobileContract")%>" method="post" name="añadirTelefono">
                                <table>

                                    <tr>
                                        <td><br></td>
                                    </tr>
                                    <tr>
                                        <td><span class="azul" id="azul">N&uacute;mero de tel&eacute;fono: </span></td>
                                        <td><input name="numero" type="hidden" value=""/></td>
                                    </tr>
                                    <tr>
                                        <td><br></td>
                                    </tr>
                                     <tr>
                                        <td><span id="azul">Cuenta:</span></td>
                                        <td><select name="bank" id="bank">
                                                <%
    Userdom u = (Userdom) request.getSession().getAttribute("user");
    Iterator it = new Operations().getBankaccountsList(u).iterator();
    String s = request.getParameter("idMobileContract");
    Integer i = Integer.parseInt(s);
    Mobilecontract m = new Operations().getMobileContract(i);
    int idCon = m.getContract().getIdContract();
    while (it.hasNext()) {
        Bankaccount b = (Bankaccount) it.next();

                                                %>
                                                <option  value="<% out.print(b.getIdBank());%>"><% out.print(b.getName());%></option>

                                                <%
    }
                                                %>


                                        </select></td>
                                    </tr>
                                    <tr>
                                        <input name="idCon" type="hidden" value="<%=idCon%>">
                                        <td><br></td>
                                    </tr>
                                    <tr>
                                        <td><span class="azul" id="azul">Compa&ntilde;&iacute;a del tel&eacute;fono: </span></td>
                                        <td><SELECT name="compania" SIZE="1" >
                                                <option selected value="Compa&ntilde;&iacute;a"></option>
                                                <OPTION VALUE="Orange">Orange</OPTION>
                                                <OPTION VALUE="Vodafone">Vodafone</OPTION>
                                                <OPTION VALUE="Movistar">Movistar</OPTION>
                                        </SELECT></td>
                                    </tr>
                                    <tr>
                                        <td><br></td>
                                    </tr>
                                    <tr>
                                        <td><span id="azul">Fecha del Contrato: </span></td>
                                        <td><input name="fecha" id="fecha" class="fecha" type="text" value="<%=m.getContract().getDateContract() %>" readonly="readonly"/></td>
                                        <td><button name="mas" id="mas" class="mas"></button></td>

                                    </tr>
                                    <tr>
                                        <td><br></td>
                                    </tr>
                                    <tr>
                                        <td><span class="azul" id="azul">N&uacute;mero de tel&eacute;fono: </span></td>
                                        <td><input name="numero" type="hidden" value="<%=m.getMobileNumber() %>"/></td>
                                    </tr>
                                    <tr>
                                        <td><br></td>
                                    </tr>
                                    <tr>
                                        <td><span class="azul" id="azul">Permanencia:<address>(en meses)</address> </span></td>
                                        <td><input name="permanencia" type="text" value="<%=m.getPermanence() %>"/></td>

                                    </tr><tr>
                                        <td><br></td>
                                    </tr>



                                    <tr align="center">

                                        <td><input name="aceptar" type="submit" value="" id="aceptar"></td>
                                        <td><input type="button" value="" id="atras" onclick="javascript:history.back();"></td>
                                    </tr>


                                </table>
<br><br><br><br><br><br><br>


                            </form>
                        </div>

                        <div id="barraDer">


                <div id="accesos">
                    <table align="center">
                        <tr ><td id="campoAzul" align="center" valign="middle" width="235px"><span id="blanco">Datos actuales</span><br></td></tr>
                    </table>

                    <p align="center"><a href="./nuevoContTelefono.jsp" id="azul"><span onmouseover='this.style.color="#FF9900"' onmouseout='this.style.color="#79A9D9"'>A&ntilde;adir teléfono</span></a></p>
                    <p align="center"> <a href="./facturaMovil.jsp?error=false" id="azul"><span onmouseover='this.style.color="#FF9900"' onmouseout='this.style.color="#79A9D9"'>A&ntilde;adir factura</span></a> </p>
                    <p align="center"><a href="./facturaMovil.jsp?error=false" id="azul"><span onmouseover='this.style.color="#FF9900"' onmouseout='this.style.color="#79A9D9"'>Comprobar estadísticas</span></a> </p>

                </div>

            </div>
                    </div>


                    <div id="abajo" align="center"><p>&copy;   Domeco &mdash; Proyecto Informático A&ntilde;o 2009 </p></div>





                </td>
            </tr>
        </table>
        <%} else {%>
        <jsp:forward page="./index.jsp"></jsp:forward>
        <%}%>
    </body>
</html>
